package com.jk.garden1.controller;


import com.jk.garden1.entity.FollowPeopleEntity;
import com.jk.garden1.entity.SubscribeEntity;
import com.jk.garden1.entity.VisitorEntity;
import com.jk.garden1.service.VisitorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.IOException;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.UUID;

/**
 * 访客管理
 */
@RestController
@RequestMapping("visitor")
public class VisitorController {
    @Autowired
    private VisitorService visitorService;
    /**
     * 查询全部
     */
    @RequestMapping("selectVisitorList")
    public List<VisitorEntity> selectVisitorList(){
        return visitorService.selectVisitorList();
    }
    /**
     * 新增访客信息
     */
    @RequestMapping("addVisitor")
    public void addVisitor(VisitorEntity visitorEntity) {
        visitorService.addVisitor(visitorEntity);
    }
    /**
     * 拉黑
     */
    @RequestMapping("updateState")
    public void updateState(Integer visitorid){
        visitorService.updateState(visitorid);
    }


    /**
     * es高亮查询
     */
    @RequestMapping("queryEsList")
    public Object queryEsList(VisitorEntity visitor){
        return visitorService.queryEsList(visitor);
    }

    /**
     * 查询今日访客总数
     */
    @RequestMapping("findfangkeCount")
    public List<VisitorEntity> findfangkeCount(){
        return visitorService.findfangkeCount();
    }
    /**
     * 查询随访人
     */
    @RequestMapping("findsuifangCount")
    public SubscribeEntity findsuifangCount(Integer visitorid){
        return visitorService.findsuifangCount(visitorid);
    }
}
